3.2.6 \(\int \frac {\cos ^4(c+d x)}{a+i a \tan (c+d x)} \, dx\) [106]

Optimal. Leaf size=134 \[ \frac {5 x}{16 a}-\frac {i a}{32 d (a-i a \tan (c+d x))^2}-\frac {i}{8 d (a-i a \tan (c+d x))}+\frac {i a^2}{24 d (a+i a \tan (c+d x))^3}+\frac {3 i a}{32 d (a+i a \tan (c+d x))^2}+\frac {3 i}{16 d (a+i a \tan (c+d x))} \]

[Out]

5/16*x/a-1/32*I*a/d/(a-I*a*tan(d*x+c))^2-1/8*I/d/(a-I*a*tan(d*x+c))+1/24*I*a^2/d/(a+I*a*tan(d*x+c))^3+3/32*I*a
/d/(a+I*a*tan(d*x+c))^2+3/16*I/d/(a+I*a*tan(d*x+c))

________________________________________________________________________________________

Rubi [A]
time = 0.08, antiderivative size = 134, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {3568, 46, 212} \begin {gather*} \frac {i a^2}{24 d (a+i a \tan (c+d x))^3}-\frac {i a}{32 d (a-i a \tan (c+d x))^2}+\frac {3 i a}{32 d (a+i a \tan (c+d x))^2}-\frac {i}{8 d (a-i a \tan (c+d x))}+\frac {3 i}{16 d (a+i a \tan (c+d x))}+\frac {5 x}{16 a} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]^4/(a + I*a*Tan[c + d*x]),x]

[Out]

(5*x)/(16*a) - ((I/32)*a)/(d*(a - I*a*Tan[c + d*x])^2) - (I/8)/(d*(a - I*a*Tan[c + d*x])) + ((I/24)*a^2)/(d*(a
 + I*a*Tan[c + d*x])^3) + (((3*I)/32)*a)/(d*(a + I*a*Tan[c + d*x])^2) + ((3*I)/16)/(d*(a + I*a*Tan[c + d*x]))

Rule 46

Int[((a_) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*x
)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && Lt
Q[m + n + 2, 0])

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 3568

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(a^(m - 2)*b
*f), Subst[Int[(a - x)^(m/2 - 1)*(a + x)^(n + m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x
] && EqQ[a^2 + b^2, 0] && IntegerQ[m/2]

Rubi steps

\begin {align*} \int \frac {\cos ^4(c+d x)}{a+i a \tan (c+d x)} \, dx &=-\frac {\left (i a^5\right ) \text {Subst}\left (\int \frac {1}{(a-x)^3 (a+x)^4} \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=-\frac {\left (i a^5\right ) \text {Subst}\left (\int \left (\frac {1}{16 a^4 (a-x)^3}+\frac {1}{8 a^5 (a-x)^2}+\frac {1}{8 a^3 (a+x)^4}+\frac {3}{16 a^4 (a+x)^3}+\frac {3}{16 a^5 (a+x)^2}+\frac {5}{16 a^5 \left (a^2-x^2\right )}\right ) \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=-\frac {i a}{32 d (a-i a \tan (c+d x))^2}-\frac {i}{8 d (a-i a \tan (c+d x))}+\frac {i a^2}{24 d (a+i a \tan (c+d x))^3}+\frac {3 i a}{32 d (a+i a \tan (c+d x))^2}+\frac {3 i}{16 d (a+i a \tan (c+d x))}-\frac {(5 i) \text {Subst}\left (\int \frac {1}{a^2-x^2} \, dx,x,i a \tan (c+d x)\right )}{16 d}\\ &=\frac {5 x}{16 a}-\frac {i a}{32 d (a-i a \tan (c+d x))^2}-\frac {i}{8 d (a-i a \tan (c+d x))}+\frac {i a^2}{24 d (a+i a \tan (c+d x))^3}+\frac {3 i a}{32 d (a+i a \tan (c+d x))^2}+\frac {3 i}{16 d (a+i a \tan (c+d x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.29, size = 109, normalized size = 0.81 \begin {gather*} -\frac {\sec (c+d x) (60 i (i+2 d x) \cos (c+d x)+15 \cos (3 (c+d x))+\cos (5 (c+d x))+60 i \sin (c+d x)-120 d x \sin (c+d x)+45 i \sin (3 (c+d x))+5 i \sin (5 (c+d x)))}{384 a d (-i+\tan (c+d x))} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]^4/(a + I*a*Tan[c + d*x]),x]

[Out]

-1/384*(Sec[c + d*x]*((60*I)*(I + 2*d*x)*Cos[c + d*x] + 15*Cos[3*(c + d*x)] + Cos[5*(c + d*x)] + (60*I)*Sin[c
+ d*x] - 120*d*x*Sin[c + d*x] + (45*I)*Sin[3*(c + d*x)] + (5*I)*Sin[5*(c + d*x)]))/(a*d*(-I + Tan[c + d*x]))

________________________________________________________________________________________

Maple [A]
time = 0.73, size = 102, normalized size = 0.76

method result size
risch \(\frac {5 x}{16 a}+\frac {i {\mathrm e}^{-6 i \left (d x +c \right )}}{192 d a}+\frac {i \cos \left (4 d x +4 c \right )}{32 d a}+\frac {3 \sin \left (4 d x +4 c \right )}{64 d a}+\frac {5 i \cos \left (2 d x +2 c \right )}{64 d a}+\frac {15 \sin \left (2 d x +2 c \right )}{64 d a}\) \(96\)
derivativedivides \(\frac {-\frac {5 i \ln \left (\tan \left (d x +c \right )-i\right )}{32}-\frac {3 i}{32 \left (\tan \left (d x +c \right )-i\right )^{2}}-\frac {1}{24 \left (\tan \left (d x +c \right )-i\right )^{3}}+\frac {3}{16 \left (\tan \left (d x +c \right )-i\right )}+\frac {i}{32 \left (\tan \left (d x +c \right )+i\right )^{2}}+\frac {5 i \ln \left (\tan \left (d x +c \right )+i\right )}{32}+\frac {1}{8 \tan \left (d x +c \right )+8 i}}{d a}\) \(102\)
default \(\frac {-\frac {5 i \ln \left (\tan \left (d x +c \right )-i\right )}{32}-\frac {3 i}{32 \left (\tan \left (d x +c \right )-i\right )^{2}}-\frac {1}{24 \left (\tan \left (d x +c \right )-i\right )^{3}}+\frac {3}{16 \left (\tan \left (d x +c \right )-i\right )}+\frac {i}{32 \left (\tan \left (d x +c \right )+i\right )^{2}}+\frac {5 i \ln \left (\tan \left (d x +c \right )+i\right )}{32}+\frac {1}{8 \tan \left (d x +c \right )+8 i}}{d a}\) \(102\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)^4/(a+I*a*tan(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d/a*(-5/32*I*ln(tan(d*x+c)-I)-3/32*I/(tan(d*x+c)-I)^2-1/24/(tan(d*x+c)-I)^3+3/16/(tan(d*x+c)-I)+1/32*I/(tan(
d*x+c)+I)^2+5/32*I*ln(tan(d*x+c)+I)+1/8/(tan(d*x+c)+I))

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^4/(a+I*a*tan(d*x+c)),x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: Error executing code in Maxima: expt: undefined: 0 to a negative e
xponent.

________________________________________________________________________________________

Fricas [A]
time = 0.36, size = 76, normalized size = 0.57 \begin {gather*} \frac {{\left (120 \, d x e^{\left (6 i \, d x + 6 i \, c\right )} - 3 i \, e^{\left (10 i \, d x + 10 i \, c\right )} - 30 i \, e^{\left (8 i \, d x + 8 i \, c\right )} + 60 i \, e^{\left (4 i \, d x + 4 i \, c\right )} + 15 i \, e^{\left (2 i \, d x + 2 i \, c\right )} + 2 i\right )} e^{\left (-6 i \, d x - 6 i \, c\right )}}{384 \, a d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^4/(a+I*a*tan(d*x+c)),x, algorithm="fricas")

[Out]

1/384*(120*d*x*e^(6*I*d*x + 6*I*c) - 3*I*e^(10*I*d*x + 10*I*c) - 30*I*e^(8*I*d*x + 8*I*c) + 60*I*e^(4*I*d*x +
4*I*c) + 15*I*e^(2*I*d*x + 2*I*c) + 2*I)*e^(-6*I*d*x - 6*I*c)/(a*d)

________________________________________________________________________________________

Sympy [A]
time = 0.22, size = 219, normalized size = 1.63 \begin {gather*} \begin {cases} \frac {\left (- 50331648 i a^{4} d^{4} e^{16 i c} e^{4 i d x} - 503316480 i a^{4} d^{4} e^{14 i c} e^{2 i d x} + 1006632960 i a^{4} d^{4} e^{10 i c} e^{- 2 i d x} + 251658240 i a^{4} d^{4} e^{8 i c} e^{- 4 i d x} + 33554432 i a^{4} d^{4} e^{6 i c} e^{- 6 i d x}\right ) e^{- 12 i c}}{6442450944 a^{5} d^{5}} & \text {for}\: a^{5} d^{5} e^{12 i c} \neq 0 \\x \left (\frac {\left (e^{10 i c} + 5 e^{8 i c} + 10 e^{6 i c} + 10 e^{4 i c} + 5 e^{2 i c} + 1\right ) e^{- 6 i c}}{32 a} - \frac {5}{16 a}\right ) & \text {otherwise} \end {cases} + \frac {5 x}{16 a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)**4/(a+I*a*tan(d*x+c)),x)

[Out]

Piecewise(((-50331648*I*a**4*d**4*exp(16*I*c)*exp(4*I*d*x) - 503316480*I*a**4*d**4*exp(14*I*c)*exp(2*I*d*x) +
1006632960*I*a**4*d**4*exp(10*I*c)*exp(-2*I*d*x) + 251658240*I*a**4*d**4*exp(8*I*c)*exp(-4*I*d*x) + 33554432*I
*a**4*d**4*exp(6*I*c)*exp(-6*I*d*x))*exp(-12*I*c)/(6442450944*a**5*d**5), Ne(a**5*d**5*exp(12*I*c), 0)), (x*((
exp(10*I*c) + 5*exp(8*I*c) + 10*exp(6*I*c) + 10*exp(4*I*c) + 5*exp(2*I*c) + 1)*exp(-6*I*c)/(32*a) - 5/(16*a)),
 True)) + 5*x/(16*a)

________________________________________________________________________________________

Giac [A]
time = 0.51, size = 116, normalized size = 0.87 \begin {gather*} -\frac {-\frac {30 i \, \log \left (\tan \left (d x + c\right ) + i\right )}{a} + \frac {30 i \, \log \left (\tan \left (d x + c\right ) - i\right )}{a} + \frac {3 \, {\left (-15 i \, \tan \left (d x + c\right )^{2} + 38 \, \tan \left (d x + c\right ) + 25 i\right )}}{a {\left (-i \, \tan \left (d x + c\right ) + 1\right )}^{2}} - \frac {55 i \, \tan \left (d x + c\right )^{3} + 201 \, \tan \left (d x + c\right )^{2} - 255 i \, \tan \left (d x + c\right ) - 117}{a {\left (\tan \left (d x + c\right ) - i\right )}^{3}}}{192 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^4/(a+I*a*tan(d*x+c)),x, algorithm="giac")

[Out]

-1/192*(-30*I*log(tan(d*x + c) + I)/a + 30*I*log(tan(d*x + c) - I)/a + 3*(-15*I*tan(d*x + c)^2 + 38*tan(d*x +
c) + 25*I)/(a*(-I*tan(d*x + c) + 1)^2) - (55*I*tan(d*x + c)^3 + 201*tan(d*x + c)^2 - 255*I*tan(d*x + c) - 117)
/(a*(tan(d*x + c) - I)^3))/d

________________________________________________________________________________________

Mupad [B]
time = 3.72, size = 123, normalized size = 0.92 \begin {gather*} \frac {5\,x}{16\,a}+\frac {\frac {25\,\mathrm {tan}\left (c+d\,x\right )}{48\,a}+\frac {1{}\mathrm {i}}{6\,a}+\frac {{\mathrm {tan}\left (c+d\,x\right )}^2\,25{}\mathrm {i}}{48\,a}+\frac {5\,{\mathrm {tan}\left (c+d\,x\right )}^3}{16\,a}+\frac {{\mathrm {tan}\left (c+d\,x\right )}^4\,5{}\mathrm {i}}{16\,a}}{d\,\left ({\mathrm {tan}\left (c+d\,x\right )}^5\,1{}\mathrm {i}+{\mathrm {tan}\left (c+d\,x\right )}^4+{\mathrm {tan}\left (c+d\,x\right )}^3\,2{}\mathrm {i}+2\,{\mathrm {tan}\left (c+d\,x\right )}^2+\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}+1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(c + d*x)^4/(a + a*tan(c + d*x)*1i),x)

[Out]

(5*x)/(16*a) + ((25*tan(c + d*x))/(48*a) + 1i/(6*a) + (tan(c + d*x)^2*25i)/(48*a) + (5*tan(c + d*x)^3)/(16*a)
+ (tan(c + d*x)^4*5i)/(16*a))/(d*(tan(c + d*x)*1i + 2*tan(c + d*x)^2 + tan(c + d*x)^3*2i + tan(c + d*x)^4 + ta
n(c + d*x)^5*1i + 1))

________________________________________________________________________________________